# Maintainer:  Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=perl-error
_realname=Error
pkgver=0.17029
pkgrel=1
pkgdesc="Perl module error/exception handling in an OO-ish way"
url="https://metacpan.org/release/Error"
arch="noarch"
license="GPL-1.0-or-later OR Artistic-1.0-Perl"
depends="perl"
subpackages="$pkgname-doc"
source="https://cpan.metacpan.org/authors/id/S/SH/SHLOMIF/Error-$pkgver.tar.gz"
builddir="$srcdir"/$_realname-$pkgver

prepare() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
}

build() {
	export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}')
	make
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" install
	find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete
}

sha512sums="266ba1feff897c1d162e69a83e595cb40da9a6e1d8b10cc5531626eff392c6da94be03ba722c74827fc2ea0d9d1c1e62e824d9021e098b700db65dd0b3acbd0a  Error-0.17029.tar.gz"
